home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0294feb.archive / 000033_donews!crash!ic….com!THORNTONJ_Tue, 8 Feb 94 07:54:01 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  6KB

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1rp7@bkhouse.cts.com>; Tue, 8 Feb 94 07:54:01 PST
  3. Received: from crash by donews.cts.com with uucp
  4.     (Smail3.1.28.1 #18) id m0pTkZg-0001qKC; Tue, 8 Feb 94 00:01 EST
  5. Received: from beast.cs.hh.ab.com by crash.cts.com with smtp
  6.     (Smail3.1.28.1 #18) id m0pTk85-0000iXC; Mon, 7 Feb 94 20:32 PST
  7. Date: Mon, 7 Feb 1994 23:32:36 -0500 (EST)
  8. Message-Id: <940207233236.2041eb4a@iccgcc.cs.hh.ab.com>
  9. From: THORNTONJ@iccgcc.cs.hh.ab.com
  10. To: AMIGAE@BKHOUSE.CTS.COM
  11. Subject: FANTASY ADVENTURE ENGINE
  12.  
  13.  
  14. Here is my program. The data strings should work as is but the Line and
  15. Box functions in the drawmap() proc should be put back into one statement
  16. I think. I broke them down so that they would mail better.
  17.  
  18. Don't forget to cut this out
  19.  
  20. Please let me know if you can find what's wrong with it.
  21.  
  22. Thanks in advance
  23.  
  24. jessie
  25. thorntonj@beast.cs.hh.ab.com
  26.  
  27. ---8<-------8<------8<------cut here -----8<-----8<------8<------8<---
  28.  /* Fantasy Adventure Engine in E */
  29.  
  30. OPT OSVERSION=37
  31.  
  32. MODULE 'intuition/screens'
  33.  
  34. ENUM OKAY,NOSCREEN,NOSIG
  35.  
  36. DEF vwalls[86]:STRING, hwalls[86]:STRING, vdoors[86]:STRING, hdoors[86]:STRING,
  37.     command[80]:STRING, ccon, oldstd, mapcon, statcon, miscon, myscrn=NIL, 
  38.     sig=-1, name, temp, row, col
  39.  
  40. PROC main()
  41.  
  42. /* this is information for the map later to be read in out of a file */
  43. /* originally these were one line each but broke them up to mail out */
  44. vwalls := '65534000000001457854000000012600000004485069400000'+
  45.           '9600000000179200000000006553400000'
  46. hwalls := '00000327670000032516000310000000903000240307200903'+
  47.           '0000038400000000007319920076832767'
  48. hdoors := '00000000000000000004000010000000000000000102400002'+
  49.           '0000000000000000000021760051200000'
  50. vdoors := '00000000000000832776000000002400000000640000400000'+
  51.           '0000000000000000000000000038400000'
  52. command := 'test'
  53. row := 16
  54. col := 8
  55.   openmyscreen()
  56.   openwindows()
  57.     oldstd := SetStdOut(miscon)
  58.     WriteF('This is my first program in E!\n')
  59.     WriteF('Enter Quit to stop program\n')
  60.     WHILE StrCmp(command,'QUIT',ALL)=FALSE
  61.       drawmap()
  62.       printstatus()
  63.       temp := SetStdOut(ccon)
  64.       WriteF('COMMAND>')
  65.       ReadStr(ccon,command)
  66.       WriteF('\n')
  67.       UpperStr(command)
  68.       docommand()
  69.     ENDWHILE
  70.  
  71.  
  72.     closewindows()
  73.     closemyscreen()
  74. ENDPROC
  75.  
  76. PROC printstatus()
  77.   temp := SetStdOut(statcon)
  78.   WriteF('This is where the characters stats wil be printed\n')
  79.   WriteF('This is where the general info will be\n')
  80.   WriteF('This will be info about the game\n')
  81.   temp := SetStdOut(ccon)
  82. ENDPROC
  83.  
  84. PROC openmyscreen()
  85.   IF (myscrn:=OpenScreenTagList(0,
  86.       [SA_DEPTH,4,
  87.        SA_DISPLAYID,$8004,
  88.        SA_PUBNAME,name:='FAE',
  89.        SA_PENS,0,
  90.        SA_TITLE,name,
  91.        SA_PUBSIG,IF (sig:=AllocSignal(-1))=NIL THEN Raise(NOSIG) ELSE sig,
  92.        SA_PUBTASK,NIL,
  93.        0,0]))=NIL THEN Raise(NOSCREEN)
  94.   PubScreenStatus(myscrn,0)
  95.   SetDefaultPubScreen(name)
  96.   SetPubScreenModes(SHANGHAI)
  97. ENDPROC
  98.  
  99. PROC closemyscreen()
  100.   CloseS(myscrn)
  101. ENDPROC
  102.  
  103. PROC openwindows()
  104.   IF mapcon:=OpenW(1,1,190,185,$200,$F,'Map',NIL,1,NIL)
  105.   ENDIF
  106.   IF statcon:=Open('con:190/1/450/55/Status',NEWFILE)
  107.   ENDIF
  108.   IF miscon:=Open('con:190/55/450/131/Misc',NEWFILE)
  109.   ENDIF
  110.   IF ccon:=Open('con:1/185/640/215/Commands',NEWFILE)
  111.   ENDIF
  112. ENDPROC
  113.  
  114. PROC docommand()
  115.   IF command := '8'
  116.      row:=row-1 /* this is my original line */
  117. /* also tried;  row--   */
  118.   ENDIF
  119. ENDPROC
  120.  
  121. PROC closewindows()
  122.    Close(ccon)
  123.    CloseW(mapcon)
  124.    Close(statcon)
  125.    Close(miscon)
  126. ENDPROC
  127.  
  128.  
  129.  
  130. PROC drawmap()
  131.    /* draw map and position character icon */
  132.    DEF i, ii, vbase, hbase, verwal[6]:STRING, horwal[5]:STRING,
  133.        verdor[5]:STRING, hordor[5]:STRING, nvwal, nhwal, nvdor, nhdor
  134.    vbase := 15
  135.    hbase := 7
  136.    FOR i:= 1 TO 17
  137.    MidStr(verwal,vwalls,(i-1)*5,5)
  138.    MidStr(horwal,hwalls,(i-1)*5,5)
  139.    MidStr(verdor,vdoors,(i-1)*5,5)
  140.    MidStr(hordor,hdoors,(i-1)*5,5)
  141.    nvwal:=Val(verwal,NIL)
  142.    nhwal:=Val(horwal,NIL)
  143.    nvdor:=Val(verdor,NIL)
  144.    nhdor:=Val(hordor,NIL)
  145.      FOR ii := 1 TO 16
  146. /* these Line commands were one line, broke them up for mailing */
  147.        IF nvwal AND Shl(1,ii-1)
  148.          Line(hbase+((ii-1)*10),vbase+((i-1)*10),
  149.               (hbase+10)+((ii-1)*10),vbase+((i-1)*10),2)
  150.        ENDIF
  151.        IF nhwal AND Shl(1,ii-1)
  152.          Line(hbase+((i-1)*10),vbase+((ii-1)*10),
  153.                hbase+((i-1)*10),(vbase+10)+((ii-1)*10),2)
  154.        ENDIF
  155.        IF nvdor AND Shl(1,ii-1)
  156.          Box(hbase+3+((ii-1)*10),(vbase-1)+((i-1)*10),
  157.               hbase+7+((ii-1)*10),(vbase+1)+((i-1)*10),3)
  158.        ENDIF
  159.        IF nhdor AND Shl(1,ii-1)
  160.          Box((hbase-1)+((i-1)*10),vbase+3+((ii-1)*10),
  161.              (hbase+1)+((i-1)*10),vbase+7+((ii-1)*10),3)
  162.        ENDIF
  163.      ENDFOR
  164.    ENDFOR
  165.    Box(hbase+((col-1)*10)+4,vbase+((row-1)*10)+2,
  166.         hbase+((col-1)*10)+5,vbase+((row-1)*10)+5,1)
  167.    Line(hbase+((col-1)*10)+3,vbase+((row-1)*10)+4,
  168.          hbase+((col-1)*10)+6,vbase+((row-1)*10)+4,1)
  169.    Line(hbase+((col-1)*10)+2,vbase+((row-1)*10)+2,
  170.          hbase+((col-1)*10)+2,vbase+((row-1)*10)+3,1)
  171.    Line(hbase+((col-1)*10)+7,vbase+((row-1)*10)+2,
  172.          hbase+((col-1)*10)+7,vbase+((row-1)*10)+3,1)
  173.    Line(hbase+((col-1)*10)+3,vbase+((row-1)*10)+6,
  174.          hbase+((col-1)*10)+3,vbase+((row-1)*10)+6,1)
  175.    Line(hbase+((col-1)*10)+6,vbase+((row-1)*10)+6,
  176.          hbase+((col-1)*10)+6,vbase+((row-1)*10)+6,1)
  177.    Line(hbase+((col-1)*10)+2,vbase+((row-1)*10)+7,
  178.          hbase+((col-1)*10)+3,vbase+((row-1)*10)+7,1)
  179.    Line(hbase+((col-1)*10)+6,vbase+((row-1)*10)+7,
  180.          hbase+((col-1)*10)+7,vbase+((row-1)*10)+7,1)
  181. ENDPROC
  182.  
  183.